package com.beiing.tianshuai.tianshuai.message.presenter;

import com.beiing.tianshuai.tianshuai.base.BasePresenter;
import com.beiing.tianshuai.tianshuai.entity.CommonBean;
import com.beiing.tianshuai.tianshuai.message.model.EditGroupInfoModel;
import com.beiing.tianshuai.tianshuai.message.model.EditGroupInfoModelImpl;
import com.beiing.tianshuai.tianshuai.message.view.EditGroupInfoViewImpl;

/**
 * Created by Jinni on 2017/9/21 0021.
 */

public class EditGroupInfoPresenter extends BasePresenter implements EditGroupInfoPresenterImpl, EditGroupInfoModel.OnRequestListener{

    private EditGroupInfoViewImpl mView;
    private EditGroupInfoModelImpl mModel;

    public EditGroupInfoPresenter(EditGroupInfoViewImpl view) {
        mView = view;
        mModel = new EditGroupInfoModel(this);
    }

    @Override
    public void getEditGroupInfoRequestResponse(String uid, String gid, String groupId, String groupName, String groupDesc, String groupNotice) {
        mView.showProgress();
        mModel.getEditGroupInfoRequestResponse(uid, gid, groupId, groupName, groupDesc, groupNotice);
    }

    @Override
    public void onSuccess(CommonBean bean) {
        mView.hideProgress();
        mView.onRequestSuccess(bean);
    }

    @Override
    public void onError(Throwable throwable) {
        mView.hideProgress();
        mView.onRequestFailed(throwable);
    }
}
